<script>
function IsAll()
{
	var err=""
	var elems = document.getElementsByTagName('input'), i;
	for (i = 0; i < elems.length; i++) {
		if((' ' + elems[i].className + ' ').indexOf(' must ') > -1)
		{
			if(elems[i].value == "") err=err+"Enter "+ elems[i].name+ "!\n";
		}
	}
	if(err != "")
	{
		alert(err);
		return false;
	}
	pwsmd5();
	return true;
}
function pwsmd5(){
    var elem = document.getElementById('psw');
	var sma=getCookie("Msma37");
	var fi="0";
	if (sma == undefined)
	{
		sma="";
	}
	else
	{
		fi=sma.substr(fi,2);
	}
	fi=parseInt(fi,10);
	if(isNaN(fi)){fi = 0;}
	fi=fi%23;
    if (elem != undefined)
	{
		elem.style.color = "white";
		elem.value = hex_md5(elem.value);
		localStorage.setItem("Mcod37", elem.value.substr(fi,9));
		elem.value = hex_md5(elem.value+sma);
	}
}
 if (!localStorage){
	alert("You have to use IE 8+,Firefox 3.5+, Chrome 4+, Opera 10.5+, Iphone 2+ or Android 2+ to be able to log in!")
 }
 if(!navigator.cookieEnabled){
	alert("You have to enable cookies to be able to log in!")
 }
</script>
<br>
<span>
	<h4 class='err'>%FAIL%</h4>
</span>
<form name="login" action="login" onsubmit="return IsAll()" >
	<table>
		<tr><td><p>User name:</p></td><td width="10px">&nbsp;</td><td><input type="Text" class="must" name="user"></td>
		<tr><td><p>Password:</p></td><td width="10px">&nbsp;</td><td><input type="password" id="psw" class="must" name="password"></td>
		<tr><td><input type="submit" value="Login"></td></tr>
	</table>
</form>
